package com.hqyj.controller;


import com.hqyj.pojo.Exam;
import com.hqyj.service.IExamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.HashMap;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author rock
 * @since 2021-11-22
 */
@RestController
@RequestMapping("/exam")
public class ExamController {
    @Autowired
    private IExamService examService;
    //加载表格数据
    @GetMapping(value = "/list")
    public  HashMap<String,Object> listPage(Exam exam){



        return examService.select(exam);


    }
    @PostMapping(value = "/add")
    public HashMap<String,Object> add(Exam exam){

        return examService.add(exam);
    }

    @PostMapping(value = "/update")
    public HashMap<String ,Object> update(Exam exam){
        return examService.update(exam);
    }

    @PostMapping("/del")
    public HashMap<String ,Object> del(Integer iexamId){
        return examService.del(iexamId);
    }

    @GetMapping("/selectStudent")
    public HashMap<String, Object> selectStudent(Integer studentNumber) {
        return examService.selectStudent(studentNumber);
    }
}

